package com.kantboot.api.phone.controller;

import com.kantboot.api.phone.domain.ApiPhoneBelongTo;
import com.kantboot.api.phone.service.IApiPhoneBelongToService;
import com.kantboot.util.common.result.RestResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/phone/phoneBelongTo")
public class ApiPhoneBelongToController {

    @Resource
    private IApiPhoneBelongToService service;

    /**
     * 根据手机号获取归属地
     */
    @RequestMapping("/getByPhone")
    public RestResult<ApiPhoneBelongTo> getByPhone(@RequestParam("phone") String phone) {
        return RestResult.success(service.getByPhone(phone), "getSuccess","获取成功");
    }

}
